<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="${pageContext.request.contextPath }/js/kindeditor-4.1.10/themes/default/default.css" type="text/css" rel="stylesheet">
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath }/js/kindeditor-4.1.10/kindeditor-all-min.js"></script>
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath }/js/kindeditor-4.1.10/lang/zh_CN.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/ajaxfileupload.js"></script>
<link id="easyuiTheme" rel="stylesheet" type="text/css"	href="${pageContext.request.contextPath }/js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/js/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/default.css">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/easyui/jquery.easyui.min.js"></script>
<script	src="${pageContext.request.contextPath }/js/easyui/locale/easyui-lang-zh_CN.js"	type="text/javascript"></script>
<script src="${pageContext.request.contextPath }/js/outOfBounds.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath }/js/common.js" type="text/javascript"></script>
</head>

<body>
<div class="easyui-layout" data-options="fit:true">
	
	<div data-options="region:'center'" style="padding:5px">
	<table class="easyui-datagrid" id="userList"
       data-options="singleSelect:true,collapsible:true,pagination:true,url:'${pageContext.request.contextPath }/admin/member/chckelist.do?checkstatus=33',method:'get',pageSize:30,toolbar:toolbar,fitColumns:true">
    <thead>
        <tr>
            <th data-options="field:'realname',width:70,align:'center'">姓名</th>
            <th data-options="field:'jointype',width:40,align:'center',formatter:HONGXIN.joinType">入会形式</th>
            <th data-options="field:'companyname',width:200,align:'center'">公司名称</th>
            <th data-options="field:'job',width:150,align:'center'">目前职务</th>
            <th data-options="field:'mphone',width:100,align:'center'">手机号码</th>
            <th data-options="field:'email',width:100,align:'center'">邮箱</th>
            <!-- <th data-options="field:'joinDate',width:130,align:'center',formatter:HONGXIN.formatDateTime">申请时间</th> -->
           <!--  <th data-options="field:'id',width:80,align:'center',formatter:HONGXIN.formatUrl">审核</th> -->
            
        </tr>
    </thead>
	</table>
	</div>
</div>
</body>
<div id="userFileWindow" class="easyui-window" title="查看用户文件" data-options="modal:true,closed:true,iconCls:'icon-save',href:'${pageContext.request.contextPath }/admin/member/file_list.do'" style="width:700px;height:500px;padding:10px;"></div>

<script type="text/javascript">

	function getSelectionsIds(){
		var articleList = $("#userList");
		var sels = articleList.datagrid("getSelections");
		var ids = [];
		for(var i in sels){
			ids.push(sels[i].id);
		}
		ids = ids.join(",");
		return ids;
	}

	function register_check(id,status){
    //审核用户通过操作
    var params = {"id":id,"status":status};
    $.post("${pageContext.request.contextPath }/admin/member/file2Check.do",params, function(data){
    	if(data.status == 200){
    		$.messager.alert('提示',data.data,undefined,function(){
    			$("#userList").datagrid("reload");
    		});
    	}else{
    		$.messager.alert('提示',data.data,undefined,function(){
    			$("#userList").datagrid("reload");
    		});
    	}
    	},'json');
    	    	
    }

	var toolbar = [{
        text:'查看文件',
        iconCls:'icon-edit',
        handler:function(){
        	var id = getSelectionsIds();
        	if(id.length == 0){
        		$.messager.alert('提示','必须选择一个用户才能查看!');
        		return ;
        	}
        	if(id.indexOf(',') > 0){
        		$.messager.alert('提示','只能选择一个用户!');
        		return ;
        	}
        	
        	$("#userFileWindow").window({
            		onLoad :function(){
            			//回显文件列表操作
            			var params = {"id":id,"filetype":"2"};
                    	$.post("${pageContext.request.contextPath }/admin/member/filelist.do",params, function(data){
                			//回显数据
                    		$('#fileList').datagrid('loadData', {
                    			"total" : data.total,
                    			"rows" : data.rows
                    		});
                		},'json');
	
            		}
            		
            		}
            	).window("open");
        }
    }];
	
	//根据文件id下载文件
	 function dowload_file(fileId){
		
		var url = "${pageContext.request.contextPath }/admin/member/file/down.do?fileId="+ fileId;
	    //alert("根据文件id，执行下载操作");
	    window.open(url);
	    /* var params = {"fileId":fileId};
    	$.post("${pageContext.request.contextPath }/member/file/down.do",params, function(data){
    		
		},'json'); */
	    	
	    	
	    	
	 }



</script>
